package com.act.moudles.act.vo;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.util.CollectionUtils;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @author: mengxiangzhong
 * @date: 2023/5/22 14:44
 * @TODO:
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class TaskVo {

    /**
     * 待处理人
     */
    private String assginee;

    /**
     * 用户流程key
     */
    private String userFlowKey;

    /**
     * 租户ID
     */
    private String tenantId;

    /**
     * 流程Id
     */
    private String procId;


    /**
     * 部署名称
     */
    private String deployName;

    /**
     * 任务名称
     */
    private String taskName;

    /**
     * 开始时间
     */
    private Date startTime;


    /**
     * 结束时间
     */
    private Date endTime;

    /**
     * 当前流程所在任务列表
     */
    private List<String>  nowDealTaskList = new ArrayList<>();

    /**
     * 当前任务所在处理人
     */
    private List<String>  nowDealUserList = new ArrayList<>();


    private String nowDealTasks;

    private String nowDealUsers;


    public void  buildNow(){
        if(!CollectionUtils.isEmpty(nowDealTaskList)){
            this.nowDealTasks = String.join("-",nowDealTaskList);
            this.nowDealUsers = String.join("-",nowDealUserList);
        }else {
            this.nowDealTasks = "流程已经结束";
            this.nowDealUsers = "";
        }
    }


}
